﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="MyWebTest.Test" Async="true" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="Scripts/jquery-1.8.2.min.js"></script>
    <script>
        function saveChangeFileUpload() {
            $("#btn_DownloadFile").click();
        }

        function OpenSaveFile() {
            $("#saveFileUpload").click();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:Label ID="labDisplay" runat="server" Text=""></asp:Label>
            <asp:Label ID="labIsConnected" runat="server" Text=""></asp:Label>
            <table>
                <tr>
                    <td>下载地址：</td>
                    <td>
                        <asp:TextBox ID="txt_Url" runat="server" Width="483px"></asp:TextBox></td>
                    <td>
                        <input value="下载" type="button" onclick="OpenSaveFile();" />
                        <asp:FileUpload ID="saveFileUpload" runat="server" onchange="saveChangeFileUpload();" Style="display: none;" />
                        <asp:Button ID="btn_DownloadFile" Style="display: none;" runat="server" Text="下载" OnClick="btn_DownloadFile_Click" /></td>
                </tr>
                <tr>
                    <td>下载结果：</td>
                    <td colspan="2">
                        <asp:Label ID="lab_Result" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
            </table>

            <asp:GridView ID="gv_DownLoad" runat="server" AutoGenerateColumns="False" ShowHeaderWhenEmpty="True">
                <Columns>
                    <asp:BoundField DataField="DocID" HeaderText="ID" Visible="false" />
                    <asp:BoundField DataField="DownPath" HeaderText="下载地址" />
                    <asp:BoundField DataField="SavePath" HeaderText="保存地址" />
                    <asp:BoundField DataField="SynSpeed" HeaderText="下载速度" />
                    <asp:BoundField DataField="SynProgress" HeaderText="下载进度" />
                    <asp:TemplateField HeaderText="操作">
                        <ItemTemplate>
                            <asp:Button ID="btn_Download" runat="server" Text="下载" OnClick="btn_Download_Click" CommandArgument='<%#Eval("DocID") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
    </form>
</body>
</html>
